<?php
	date_default_timezone_set('America/New_York');
	// sleep(1);
	require("/../globals.php");
	if(userIsLoggedIn()):
		redirectUserToSplashPage();
	else:
		if($_SERVER['REQUEST_METHOD'] == 'POST'):
			$username = sanitizeString($_POST['username']);
			$password = sanitizeString($_POST['password']);
			//var_dump($username, $password, $_SESSION, $_COOKIE);
			
			login($username, $password);		
			exit;
		elseif ($_SERVER['REQUEST_METHOD'] == 'GET'):
			include("login_form.html");
		endif;
	endif;	
?>